package com.ding.easyme.app.util;

import java.security.MessageDigest;


public class Test {

	/**
	 * @author zxb   
	 * @date 2012-8-3 下午07:53:11
	 * @param args 
	 */
	public static void main(String[] args) {
//		TelephonyManager localTelephonyManager = (TelephonyManager)paramContext.getSystemService("phone");

		String imei = "860173014636645";
//		String imsi = "460019125616213";
//		String imsi = "460019125616213​";
//		String imsi = "460019125616213​";
//		String imsi = "460019125616213​";
		String imsi = "460019125616213​​";
		System.out.println(imsi.length());
//		String imsi = new String("460019125616213​");
//		imsi = "460019125616213";
//		System.out.println(TypeConvert.byteToHexStr(imsi.getBytes()));
//		imsi = "460019125616213";
//		System.out.println(a(imei+ "" +imsi));
//		System.out.println(TypeConvert.byteToHexStr(imsi.getBytes()));
//		System.out.println((char) 0xE2 +""+ (char) 0x80 +""+ (char) 0x8B);
//		String imei = "860173014636645";
//		String imsi = "460019125616213";
//		System.out.print(a(imei+ "" +imsi));
	}

	
	 public static String a(String paramString)
	  {
	    try
	    {
	      MessageDigest localMessageDigest = MessageDigest.getInstance("MD5");
	      StringBuffer localStringBuffer = new StringBuffer(paramString);
	      localStringBuffer.append("CASEE2010");
	      System.out.println(localStringBuffer);
	      paramString = a(localMessageDigest.digest(localStringBuffer.toString().getBytes()));
//	      TypeConvert.byteToHexStr(buffer)
//	      paramString = TypeConvert.byteToHexStr(localMessageDigest.digest(localStringBuffer.toString().getBytes()));
	    }
	    catch (Exception localException)
	    {
	      paramString = "00000000000000000000000000000000";
	    }
	    return paramString;
	  }
	 
	 
	 public static String a(byte[] paramArrayOfByte)
	  {
	    StringBuffer localStringBuffer = new StringBuffer();
	    for (int i = 0; i < paramArrayOfByte.length; i++)
	    {
	      int j = paramArrayOfByte[i] >> 4 & 0x0F;
	      int k = 0;
	      do
	      {
	        if ((j >= 0) && (j <= 9))
	          localStringBuffer.append((char)(48 + j));
	        else
	          localStringBuffer.append((char)(97 + (j - 10)));
	        j = paramArrayOfByte[i] & 0xF;
	      }
	      while (k++ < 1);
	    }
	    return localStringBuffer
	.toString();
	  }

}
